<div id="com">
    <!--留言的部分-->
    <% post.comments.forEach(function (comment) { %>

        <p class="pl ">
            <%= comment.name %>
            <span class="info">回复与<% comment.time%></span>
        </p>
        <p><%- comment.content%></p>

    <% })%>
    <!--添加留言的表单-->

    <% if(user) { %>

    <form  id="from" method="post" action="/comment/<%= post.name %>/<%= post.time.minute%>/<%= post.title %>">
        发布人:<%= post.name %>
        <input type="hidden" name="name" value="<%= user.name%>"><br>
        <textarea name="content"  cols="30" rows="5" required></textarea>
        <input type="submit" value="留言">
    </form>

     <% } else{ %>
        回复先登录:<a href="/">登录</a>或<a href="/reg">注册</a>
    <textarea name="content"  cols="30" rows="5" id="tb" required></textarea>
    <input type="submit" value="留言" id="sb">
      <% } %>

</div>